package com.shop.cereshop.app.dao.buyer;

import com.shop.cereshop.app.page.buyer.MyUser;
import com.shop.cereshop.app.page.login.BuyerUser;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.canvas.CerePlatformCanvas;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CereBuyerUserDAO {
    int deleteByPrimaryKey(@Param("buyerUserId") Long buyerUserId);

    int insert(CereBuyerUser record);

    int insertSelective(CereBuyerUser record);

    CereBuyerUser selectByPrimaryKey(Long buyerUserId);

    int updateByPrimaryKeySelective(CereBuyerUser record);

    int updateByPrimaryKey(CereBuyerUser record);

    CereBuyerUser findByToken(@Param("token") String token);

    BuyerUser findByOpenid(@Param("openid") String openid);

    BuyerUser findByPhone(@Param("phone") String phone);

    void relievePhone(CereBuyerUser cereBuyerUser);

    MyUser getUser(@Param("buyerUserId") Long buyerUserId);

    CerePlatformCanvas getCanvas(CerePlatformCanvas canvas);

    CereBuyerUser getByOpenid(@Param("wechatOpenId") String wechatOpenId);

    CereBuyerUser checkPhoneWx(@Param("phone") String phone);

    void upDateWxOpenId(@Param("buyerUserId") Long buyerUserId, @Param("wechatOpenId") String wechatOpenId);

    List<BuyerUser> getByWxOpenId(@Param("wechatOpenId") String wechatOpenId);
}